﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;

namespace Guline.Web.XjsGame.Infrastructure
{
    public static class Utils
    {
        public static string UrlRewriteString(string ip_str_change)
        {
            Regex v_reg_regex = new Regex("\\p{IsCombiningDiacriticalMarks}+");
            string v_str_FormD = ip_str_change.Normalize(NormalizationForm.FormD);
            ip_str_change= v_reg_regex.Replace(v_str_FormD, String.Empty).Replace('\u0111', 'd').Replace('\u0110', 'D');
            ip_str_change = Regex.Replace(ip_str_change, @"\W","-");
            return ip_str_change.Replace("--", "-").ToLower();
        }

    }
}